import requests


def get_html(url):
    head = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36'}
    try:
        r = requests.get(url=url, params=data, headers=head)
        r.encoding = r.apparent_encoding
        r.raise_for_status()
        return r.text
    except Exception as err:
        print(err)


if __name__ == '__main__':
    url = 'http://www.ip138.com/mobile.asp?'
    data = {'mobile': '13014336269',
            'action': 'mobile'}
    doc = get_html(url)
    print(doc)